#ifndef CONNEXION_H
#define CONNEXION_H

#include <iostream>
#include <string>
#include <fstream>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <vector>
#include "../file.h"
#include <algorithm>
#include "../MySocket.h"
#include "../SocketException.h"
#include "dirent.h"
#include <sstream>
#include "../TransferedData.h"
#include "descwindow.h"
#include "listener.h"


using namespace std;
class Connexion : public QObject
{
    Q_OBJECT
    public:
        Connexion(string,string,string,string,string,string,bool,QWidget *);
        void sendFilesList(string);
        vector<m_file> get_files_name(string dirn);
        vector<FileDescServ> getFilesList();
        void logout();
        Connection request_connection(string fileName, string author);
        void startListener(string,string);
        char* getDesc(string,string);
        vector<FileDescServ>searchDesc(string mot);


    private:
         MySocket *socketServer;
         QWidget *parent;
};

#endif // CONNEXION_H
